﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Practices.EnterpriseLibrary.PolicyInjection;

using NCS.IConnect.ApplicationContexts;

using JM.JCY.BusinessFacade;
using JM.JCY.Common;
using JM.JCY.BusinessEntity;
namespace JM.JCY.Proxy
{
    public class ApplicationProxy : JCYProxyBase<IApplication>, IApplication
    {
        private IApplication GetInstance()
        {
            return PolicyInjection.Create<ApplicationBF, IApplication>();
        }

        public ApplicationDataSet.T_ApplicationDataTable GetApplicationByName(string appName)
        {
            return GetInstance().GetApplicationByName(appName);
        }

        public ApplicationDataSet.T_ApplicationDataTable GetApplicationByType(string appType, string isVisble)
        {
            return GetInstance().GetApplicationByType(appType, isVisble);
        }
        public ApplicationDataSet.T_ApplicationDataTable GetApplicationNameById(int appId)
        {
            return this.GetInstance().GetApplicationNameById(appId);
        }




        public ApplicationDataSet.T_ApplicationRoleDataTable GetApplicationRoleByUserName(string userName)
        {
            return this.GetInstance().GetApplicationRoleByUserName(userName);
        }

        public ApplicationDataSet.T_ApplicationRoleDataTable GetApplicationRoleByAppId(int appId)
        {
            return this.GetInstance().GetApplicationRoleByAppId(appId);
        }

        public void DeleteApplicationRoleByAppId(int appId)
        {
            this.GetInstance().DeleteApplicationRoleByAppId(appId);
        }

        public void CreateApplicationRole(ApplicationDataSet.T_ApplicationRoleDataTable dt)
        {
            this.GetInstance().CreateApplicationRole(dt);
        }
    }
}
